package com.learn.springframework.aop;

import com.learn.springframework.aop.support.AdvisedSupport;

public class DefaultAopProxyFactory {

    public AopProxy createAopProxy(AdvisedSupport config) {

        Class targetClass = config.getTargetClass();
        if (targetClass.getInterfaces().length > 0) {
            return new JdkDynamicAopProxy(config);
        }
        return new CglibAopProxy(config);
    }
}
